<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>订单页面</title>
<link href="${pageContext.request.contextPath}/css/common.css"
	rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath}/css/cart.css"
	rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath}/css/product.css"
	rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.3.js">
</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/js/layer/layer.js">
</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/js/imagesize.js">
</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/js/msgbox.js">
</script>
<script type="text/javascript">
function isCancel(){
	confirm("确定删除？");
}
</script>

</head>
<body>

<div class="container header">

	<%@include file="header.jsp" %>	
	<%@include file="search.jsp" %>
	<%@include file="menu.jsp" %>

</div>

	<div class="container cart">

		<div class="span24">

			<div class="step step1">
				我的订单
				
			</div>


			<table>
				<tbody>
					<s:iterator var="order" value="pageBean.list">
						<tr>
							<th colspan="5">订单编号:<s:property value="#order.oid" />&nbsp;&nbsp;&nbsp;&nbsp;订单金额:
							<strong>
								￥&nbsp;<s:property value="#order.total" />
							</strong>
							&nbsp;&nbsp;&nbsp;&nbsp;
								<s:if test="#order.state == 1">
									未付款
								</s:if>
								<s:if test="#order.state == 2">
									已付款
								</s:if>
								<s:if test="#order.state == 3">
									<a href="${ pageContext.request.contextPath }/order_updateState.action?oid=<s:property value="#order.oid" />">确认收货</a>
								</s:if>
								<s:if test="#order.state == 4">
									交易成功
								</s:if>
							
							</th>
						</tr>
						<tr>
							<th>图片</th>
							<th>商品</th>
							<th>价格</th>
							<th>数量</th>
							<th>小计</th>
						</tr>
						<s:iterator var="orderItem" value="#order.orderItems">
							<tr>
								<td width="60">
								<img class="orderlistimg" src="${ pageContext.request.contextPath }/<s:property value="#orderItem.product.image"/>" />
								</td>
								<td>
								<a href="#">
									<s:property value="#orderItem.product.pname" />
								</a>
									
								</td>
								<td><s:property value="#orderItem.product.shop_price" /></td>
								<td class="quantity" width="60"><s:property
										value="#orderItem.count" /></td>
								<td width="140"><span class="subtotal">￥<s:property
											value="#orderItem.subtotal" />
								</span></td>
							</tr>
						</s:iterator>
						<tr>
								<td colspan="4"></td>
								<td>
								
								
									<s:if test="#order.state==1">
										<a href="${ pageContext.request.contextPath }/order_delete.action?oid=<s:property value="#order.oid" />" onclick="return isCancel();">
										<span id="cancel">取消订单</span>
										</a>
										<a href="${ pageContext.request.contextPath }/order_findByOid.action?oid=<s:property value="#order.oid" />" class="orderpay">
										立即付款
										</a>
									</s:if>
									<s:if test="#order.state==2">
										
									</s:if>
								
								</td>
							</tr>
					</s:iterator>
					<tr>
						<s:if test="pageBean.list != null">
						<th colspan="5">
						<div class="pagination">
							
							<span>第<s:property value="pageBean.page" />/<s:property
								value="pageBean.totalPage" />页 </span>
								<s:if test="pageBean.page != 1">
								<a
									href="${ pageContext.request.contextPath }/order_findByUid.action?page=1"
									class="firstPage">&nbsp;</a>
								<a
									href="${ pageContext.request.contextPath }/order_findByUid.action?page=<s:property value="pageBean.page-1"/>"
									class="previousPage">&nbsp;</a>
							</s:if> <s:iterator var="i" begin="1" end="pageBean.totalPage">
								<s:if test="pageBean.page != #i">
									<a
										href="${ pageContext.request.contextPath }/order_findByUid.action?page=<s:property value="#i"/>"><s:property
											value="#i" />
									</a>
								</s:if>
								<s:else>
									<span class="currentPage"><s:property value="#i" />
									</span>
								</s:else>
							</s:iterator> <s:if test="pageBean.page != pageBean.totalPage">
								<a class="nextPage"
									href="${ pageContext.request.contextPath }/order_findByUid.action?page=<s:property value="pageBean.page+1"/>">&nbsp;</a>
								<a class="lastPage"
									href="${ pageContext.request.contextPath }/order_findByUid.action?page=<s:property value="pageBean.totalPage"/>">&nbsp;</a>
							</s:if>
							
							</div>
							</th>
							</s:if>
					</tr>
				</tbody>
			</table>


		</div>

	</div>
	<div class="container footer">
		<div class="span24">
			<div class="footerAd">
				<img src="image/footer.jpg" alt="我们的优势" title="我们的优势" height="52" width="950"/>
			</div>
		</div>
		<%@include file="bottom.jsp" %>
	</div>
</body>
</html>